<?php
/* @var $this GatewayController */
/* @var $model Gateway */
 
$this->breadcrumbs=array(
	'Gateways'=>array('index'),
	'Manage',
);
 
if(Yii::app()->user->name=="admin"){
	    $this->menu=array(
	    	array('label'=>'路由器信息', 'url'=>array('admin')),
            array('label'=>'创建路由器', 'url'=>array('create')),
			array('label'=>'路由器地图', 'url'=>array('gatewayMap')),
	    );
	   $buttoncolumn ='{view}{update}{delete}';
    }else{
	     $this->menu=array(
			array('label'=>'路由器信息', 'url'=>array('admin')),
	     ); 
	    $buttoncolumn ='{view}';
    } 
 
?>  

<h1>路由器信息</h1>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'gateway-grid',
	'dataProvider'=>$model->with('company')->search(),
	'enableHistory'=>true,
	'filter'=>$model,
	'template'=>"{items}{summary}{pager}",
	'summaryText'=>'每页显示10条,共{count}条',
	'summaryCssClass'=>'summaryinfo',
	'emptyText'=>'没有数据',
	'itemsCssClass'=>'itemsinfo',
	'pager'=>array(
		'class'=>'CLinkPager',
		'header'=>'',
		'nextPageLabel'=>'下一页',
		'prevPageLabel'=>'上一页',
		'firstPageLabel'=>'首页',
		'lastPageLabel'=>'尾页', 
		),
	'columns'=>array(
		// 'id',
		  array(  
            'header' => '序号',  
            'value' => '$this->grid->dataProvider->getPagination()->getOffset()+($row+1)', //CDataColumn $this->grid  
            'htmlOptions' => array(  
                'width' => '40px',  
                "style"=> 'text-align:center',
            ),  
        ),  
        array(
            'name' => 'company_title',
            'value' => '$data->company->title',
             'htmlOptions' => array(  
                'width' => '120px',  
             ),  
            ), 
          array(
            'name' => 'gatewayname',
              'htmlOptions' => array(  
                'width' => '80px',  
            ),  
            ),
		'address', 
         array(
            'name' => 'lasttime',
              'htmlOptions' => array(  
                'width' => '120px',  
            ),  
         ),
		array(
			'class'=>'CButtonColumn',
			'header' => '操作', //指明头信息 
			 'template'=>$buttoncolumn,   
             'deleteConfirmation'=>"js:'是否要删除此路由信息?'",  //修改删除提示语句
             'buttons' =>array(    
                'view' => array(    
                    'label'=>'显示',    
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/caz.png',   
                ),
                'update' => array(    
                    'label'=>'修改',    
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/bianji.png',   
                ),
                'delete' => array(    
                    'label'=>'删除',    
                    'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/shanc.png',   
                ), 
            ),       
		),
	),
)); ?>
